package com.itboye.shop.me.qianbao;

import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.itboye.shop.R;
import com.itboye.shop.base.BaseActivity;
import com.itboye.shop.util.loadutil.MAlert;

/**
 * 添加银行卡
 */
public class AddBankCardActivity extends BaseActivity {
    TextView tvTitle;
    ImageView back;

    EditText add_bank_code, add_bank_num;
    Button add_bank_ok;
    String name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_bank_card);

        tvTitle.setText("绑定账户");
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.add_bank_ok:
                if (add_bank_num.getText().toString().equals("")) {
                    MAlert.alert("请填写账户", Gravity.CENTER);
                } else if (add_bank_code.getText().toString().equals("")) {
                    MAlert.alert("请填写身份信息", Gravity.CENTER);
                } else {
                    name = add_bank_num.getText().toString();
                    Intent intent = new Intent(this, AddBankCardTwoActivity.class);
                    intent.putExtra("name", name);
                    startActivity(intent);
                    finish();
                }
                break;
        }
    }
}
